<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFreightWayDemosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('freight_way_demos', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('mainborad_id')->default(0)->comment('主板ID');
            $table->string('name', 50)->default('')->comment('模板名称');
            $table->integer('freight_num')->default(0)->comment('货道数量');
            $table->timestamps();
        });
        Schema::create('freight_way_demo_data', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('freight_way_demo_id')->default(0)->comment('货道模板Id');
            $table->tinyInteger('capacity')->default(0)->comment('容量');
            $table->tinyInteger('state')->default(0)->comment('状态(0:未启用1:正常2:开路异常3:短路异常:)');
            $table->tinyInteger('type')->default(1)->comment('类型:(1:三线电机,2:二线电机,3:电磁锁,4:带反馈电磁锁,5履带,6:蛇形货道,7:特殊)');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('freight_way_demos');
    }
}
